package com.freecloud.spring.controller;

import com.freecloud.spring.common.BaseController;
import com.freecloud.spring.common.ResponseBody;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: maomao
 * @Date: 2021-05-17 13:25
 */
@RestController
@RequestMapping("/api/test/user")
public class SimplController extends BaseController {

    @GetMapping("getUser")
    public ResponseBody getUser() {
        User user = new User(1, "张三");
        return this.success(user);
    }

    public class User {
        private Integer id;
        private String name;

        public User(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
